package com.example.trans.service.impl;

import com.example.trans.dao.AccountDao;
import com.example.trans.pojo.Account;
import com.example.trans.service.AccountService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * ClassName:AccountServiceImpl2
 * Package:com.example.trans.service.impl
 * Description:
 *
 * @Author:ZhangXin
 * @Create:2023/5/11-21:01
 * @Version:v1.0
 */
@Service("accountService2")
public class AccountServiceImpl2 implements AccountService {

    @Resource(name = "accountDao")
    private AccountDao accountDao;

    @Override
    public void transfer(String fromActno, String toActno, double money) {

    }


    @Override
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void save(Account act) {
        accountDao.insert(act);

        String s = null;
        s.toString();
    }
}
